<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>编辑商品</title>

	<hdjs />
	<bootstrap />
	<css file="__PUBLIC__/Css/public.css" />
	<script type="text/javascript">

	$(function(){
		$('#start_time').calendar({format: 'yyyy-MM-dd HH:mm:ss'});
		$('#end_time').calendar({format: 'yyyy-MM-dd HH:mm:ss'});
	})
	</script>
</head>
<body>
<form action="" method="post"  class='hd-form'>

	

	<div class="wrap">
		<div class="title-header">{$shopname}</div>
		<div class="menu_list">
			<ul>
				<li><a href="{|U:'Goods/index',array('shopid'=>$data['shopid'])}"> 商品列表 </a></li>
				<li><a href="javascript:;" class="action"> 编辑商品 </a></li>
				<li><a href="{|U:'shop/index'}">商铺列表 </a></li>
			</ul>
		</div>
		<table class='table table-striped table-bordered '>
		<tbody>
			<tr>
				<td class="w100">商铺名称</td>
				<td>
					<select name="shopid" >
						<option value="0">请选择商铺</option>
						<foreach from='$shop' value='$v'>
							<option value="{$v.shopid}" <if value="$v['shopid'] eq $data['shopid']">selected='selected'</if>>{$v.shopname}</option>
						</foreach>
					</select>
				</td>
			</tr>

			<tr>
				<td class="w100">商品分类</td>
				<td>
					<select name="cid" >
						<option value="0">请选择商品分类</option>
						<foreach from='$category' value='$v'>
							<option value="{$v.cid}" <if value="$v['cid'] eq $data['cid']">selected='selected'</if>>{$v._name}</option>
						</foreach>
					</select>
				</td>
			</tr>

			<tr>
				<td class="w100">地区</td>
				<td>
					<select name="lid" >
						<option value="0">请选择地区</option>
						<foreach from='$city' value='$v'>
							<option value="{$v.lid}" <if value="$v['lid'] eq $data['lid']">selected='selected'</if>>{$v._name}</option>
						</foreach>
					</select>
				</td>
			</tr>

			<tr>
				<td class="w100">商品主标题</td>
				<td>
					<textarea name="main_title" class='w500 h100'>{$data.main_title}</textarea>
				</td>
			</tr>

			<tr>
				<td class="w100">商品副标题</td>
				<td>
					<input type="text" name="sub_title"  class='w200' value='{$data.sub_title}' />
				</td>
			</tr>

			<tr>
				<td class="w100">现价</td>
				<td>
					<input type="text" name="price"  class='w200' value='{$data.price}'/>
				</td>
			</tr>
			<tr>
				<td class="w100">原价</td>
				<td>
					<input type="text" name="old_price"  class='w200' value='{$data.old_price}'/>
				</td>
			</tr>


			<tr>
				<td class="w100">图片</td>
				<td>
					<upload size='2' type='jpg,png,gif' limit='1' name='upload' thumb="460,280,200,100,310,185,90,55"/>
					<br/>
					<img src="__ROOT__/{$data.goods_img}" alt=""  width="200" />
				</td>
			</tr>

			<tr>
				<td>开始时间</td>
				<td><input value="{$data.start_time|date:'Y-m-d H:i:s',@@}" readonly="readonly" name='start_time' type="text" id='start_time'></td>
			</tr>
			<tr>
				<td>结束时间</td>
				<td><input value="{$data.end_time|date:'Y-m-d H:i:s',@@}" readonly="readonly" name='end_time' type="text" id='end_time'></td>
			</tr>
			<tr>
				<td>购买人数</td>
				<td><input name='buy' type="text" value='{$data.buy}'/></td>
			</tr>
			
			<tr>
				<td class="w100">服务</td>
				<td>
					<foreach from='$goodsServer' value='$v' key='$k'>
					<label>
						<input type="checkbox" name="goods_server[]" value="{$k}"  <if value="in_array($k,$data['goods_server'])"> checked='checked' </if>/>{$v.name}
					</label>
					</foreach>
				</td>
			</tr>

			<tr>
				<td class="w100">详细</td>
				<td>
					<keditor name='detail' content='$data["detail"]'>		
				</td>
			</tr>
		</tbody>
	</table>
	</div>
	<div class='position-bottom'>
		<input type="submit" class='hd-success' value="编辑" />
		<input type="hidden" name="gid" value="{$data.gid}" />
		
	</div>

	</form>
</body>
</html>